import threading
from aip import AipImageClassify
import json
import time

class Detecter(threading.Thread):
    def init(self,client,img):
        threading.Thread.__init__(self)
        self.client=client
        print(client)
    def run(self):
        #self.client.advancedGeneral(img)
        return

class PlantDetectD(threading.Thread):
    def __init__(self,config):
        threading.Thread.__init__(self)
        #print("PDD initing...")
        #pass
        self.client=AipImageClassify(config["aip"]["APP_ID"], config["aip"]["API_KEY"], config["aip"]["SECRET_KEY"])
        self.db=json.load(open(config["db"]["PATH"]))
        self.delay=int(config["daemon"]["DELAY"])
    def run(self):
        img=None
        d=Detecter(args=(self.client,img))
        d.start()
        time.sleep(self.delay)
        #pass